package com.pz.account.controller;

import com.pz.account.domain.model.MemberLoginParams;
import com.pz.account.service.AccountLoginService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;


@RequestMapping("/mobile/account")
@RestController
public class AccountLoginController extends BaseController {



    @Autowired
    private AccountLoginService accountLoginService;


    @PostMapping("/registerUser")
    @ResponseBody
    public AjaxResult registerUser(HttpServletRequest request) {
        String phoneNo = request.getParameter("phoneNo");
        String validCode = request.getParameter("validCode");
        // 登录结果
        MemberLoginParams loginParams = new MemberLoginParams();
        loginParams.setPhone(phoneNo);
        loginParams.setValidCode(validCode);
        return accountLoginService.registerUser(loginParams);
    }

}
